package com.example.controller;

import com.example.entity.authority.MaintenancePartyDetail;
import com.example.service.MaintencePartyDetaiService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by simon on 2017/10/18.
 */
@RestController
@RequestMapping("api/maintenceDetail")
public class MaintencePartyDetaiController {

    @Autowired
    MaintencePartyDetaiService maintencePartyDetaiService;

    @ApiOperation(value = "查询维保单位详细信息",notes = "查询维保单位详细信息")
    @RequestMapping(value="/queryById/{id}",method = RequestMethod.POST)
    Map<String,Object> queryById(@PathVariable(value = "id") String id) {

        return maintencePartyDetaiService.queryById(id);
    }

    @ApiOperation(value = "添加维保单位详细信息",notes = "添加维保单位详细信息")
    @RequestMapping(value="/add",method = RequestMethod.POST)
    Map<String,Object> add(@RequestBody MaintenancePartyDetail maintenancePartyDetail) {

        return maintencePartyDetaiService.add(maintenancePartyDetail);
    }

    @ApiOperation(value = "修改维保单位详细信息",notes = "修改维保单位详细信息")
    @RequestMapping(value="/update",method = RequestMethod.POST)
    Map<String,Object> update(@RequestBody MaintenancePartyDetail maintenancePartyDetail) {

        return maintencePartyDetaiService.update(maintenancePartyDetail);
    }
}
